1. Field of the Invention
The present invention relates to a method and apparatus for detecting an edge in an image or video.
2. Description of the Related Art
A method for detecting an edge from an image or video such as JPEG, MPEG and H.26x, which describes image and video compression schemes, is very important in image and signal processing techniques. Edge detection has been studied a lot because it is used as a basic input in many other applications. The applications of the edge detection are used for various forms of image enhancement and are also used for object segmentation. Additionally, in the recent time, they are used for image retrieval and the shot segmentation algorithm for dividing video sequences in editing units. Also, they are usefully used for motion extraction and are used for text detection as a useful feature element.
Further, the applications of the edge detection can be usefully used for super resolution image restoration, which have been recently studied. Most of all, edge components are important factors in determining the characteristics of an image.
In the recent time, requests for transmitting and receiving an image or video via a network have been increased. To solve the problem of low communication bandwidth and efficiently store image or video data of a large volume, the image compression technique has been developed. A representative method of image compression is a JPEG codec, and methods of moving image compression include MPEG and H.26x schemes. The general principle of image and moving image compression currently used is to compress an image using the spatial redundancy by transforming the image in the spatial domain to the image in the frequency domain. At this time, the most widely used transform method is a discrete cosine transform (DCT).
In the DCT method, an original image consists of a plurality of blocks, each having m pixel×n pixel. Typically, the size of m pixel×n pixel can be selected as 4×4, 4×8, 8×8, 8×16 and the like according to which system is to be applied. Here, 8×8 is set as one block for explanation.
Thus in the DCT method, a data compression process is respectively applied to each of these blocks.
The plurality of blocks of 8×8 pixels in the original image is encoded by the DCT coding. The DCT transforms each of the blocks in the spatial domain into a frequency domain.
The 8×8 blocks can be transformed into 8×8 coefficient blocks.
In the 8×8 coefficient blocks (generally, indicated in a matrix), the coefficients are represent the content of the original 8×8 blocks.
As shown in FIG. 1, most of the information in the original block is concentrated on one coefficient. Such a coefficient is called a DC coefficient, which is the average value of the 8×8 blocks. The DC coefficient is positioned at a matrix (0,0) component.
The coefficients (AC10, AC20, AC30, etc.) arranged in the horizontal direction with respect to the DC coefficient contain horizontal edge components, and the coefficients (AC01, AC02, AC03, etc) arranged in the vertical direction contain vertical edge components.
As the conventional edge detection method, the high pass filtering method using a spatial filter in the spatial domain is widely used.
FIG. 2 illustrates one example of horizontal edge detection using a spatial filter, which comprises an edge detection filter used in the spatial filtering method, an original image and an edge image reflecting an edge. Here, the original image is the image from which an edge is detected. Additionally, as the edge detection filter, a mask is used.
In the edge detection method using the spatial filter, typically, the pixel of an edge image is obtained with respect to each pixel of the original image by using the mask.
More specifically, the pixel of the original image corresponds to one pixel of the edge image. At this time, in case of using a 3×3 matrix mask, it is necessary to perform multiplication operation 9 times and add operation 8 times in order to obtain the edge of one pixel. Such operations must be performed with respect to all pixels to obtain the edge image. Additionally, since the edge component in one direction is obtained by one scanning by such a mask, it requires applying different masks in the same manner to obtain edges in four or eight directions (masks as many as the number of edge directions have to be provided). That is, the edge detection method using the spatial filter is advantageous in that an accurate edge can be detected, but it requires several masks and its execution speed is very low according to the complexity of an operation. In other words, such a spatial filtering method is advantageous in that an accurate edge component can be detected, but it requires many operations. Thus, this method has many restrictions for use in various systems.
Actually, in many applications, the inputting of edge components approximate to actual edge components will be enough, rather than requesting accurate edge components. Also, edge detection of a high speed is needed.
Accordingly, there occurs a need for an algorithm for detecting edges which are approximate to actual edge components and which can be widely used in many applications by the simplest processing in the compression domain using the DCT.